package com.kedacom.freedomLabel.utils.validator;

import android.content.Context;

import com.kedacom.lego.fast.validation.RegexTemplate;

import java.util.regex.Pattern;

/**
 * @author licheng
 * @since 2020/2/2 13:01
 */
public class EmptyValidation extends ValidationExecutor {

    public EmptyValidation(String message) {
        super(message);
    }

    @Override
    public boolean doValidate(Context context, String text) {
        if (!Pattern.compile(RegexTemplate.NOT_EMPTY).matcher(text).matches()) {
            showToast(getMessage());
            return false;
        }
        return true;
    }

}